#include "Student.h"
#include "Student_lib.h"
#include <stdio.h>
#include <stdlib.h>

using namespace std;

struct Node{
       Student d;
       Node *next;
};

Node *head;

void InitStack(){
     head = NULL;
}

void Put(Student p){
     Node *el = new Node;
     el->d = p;
     el->next = head;
     head = el;
}

void Get(){
    if (head == NULL){
       printf("Empty stack!\n");
    }else{
       Node *pnt = head;
       head = pnt->next;
       Person temp = pnt->d;
      temp.Show();
    }
}

int main(){
    Student l[100];
    int i=0,j=0;
    ReadFile("student.txt",l,i);
    
    InitStack();
    for (j=0;j<i;j++){
        Put(l[j]);
    }
    for (j=0;j<i;j++){
        Get();
    }
    system("pause");
    return 0;
}
